﻿using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using QuanLyNganHangDe.DAL.Models.Mapping;

namespace QuanLyNganHangDe.DAL.Models
{
    public partial class QLNHD_KHContext : DbContext
    {
        public static QLNHD_KHContext GetContext()
        {
            var defaultContext = new QuanLyNganHangDe.DAL.Models.QLNHD_KHContext();
            return defaultContext;
        }
    }

    public class MyInitializer : DropCreateDatabaseIfModelChanges<QLNHD_KHContext>
    {
        protected override void Seed(QLNHD_KHContext context)
        {
            context.NguoiSuDungDbSet.Add(new NguoiSuDung
            {
                TenDangNhap = "admin",
                MatKhau = "admin",
                VaiTro = (int)NguoiSuDung.VAITRO.QuanTriHeThong,
                HoTen = "Quản trị"
            });
            context.SaveChanges();
        }
    }
}
